package com.yunxin.core.infra.persistence.mapper.popup;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.yunxin.core.infra.persistence.entity.popup.PopupDO;
import com.yunxin.core.infra.persistence.entity.popup.query.condition.PopupPageCondition;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author zero°
 * @since 2023-12-11
 */
@DS("core")
@Mapper
public interface PopupExtendMapper extends PopupMapper{
    /**
      * 查询分页总数
     * @param condition condition
     * @return long
     */
    long countPopupPageQuery(PopupPageCondition condition);

    /**
     * 分页查询列表
     * @param condition condition
     * @return List<PopupDo>
     */
    List<PopupDO> popupPageQuery(PopupPageCondition condition);

    /**
     * 查询推荐弹窗列表
     * @return List<PopupDo>
     */
    List<PopupDO> list();

    /**
     * 根据弹窗编码获取推荐弹窗信息
     * @param popupCode popupCode
     * @return PopupDo
     */
    PopupDO selectByPopupCode(@Param("popupCode") String popupCode);

    /**
     * 根据名称查询推荐弹窗
     * @param popupName popupName
     * @return PopupDo
     */
    PopupDO selectPopupByPopupName(@Param("popupName")String popupName);
}
